package com.ys;

/**
 * 1 2020-06-11 牙膏 15 2 生活用品 // 记录消费信息, 包括[时间, 物品名称, 单价, 数量, 类别]
 * @program: note
 * @description:
 * @author:
 * @create 2020-06-11 22:49
 **/
public class CommandSave extends CommandBase {

    public CommandSave(ConsumeRecordController consumeRecordController, String[] input) {
        super(consumeRecordController, input);
    }

    @Override
    public void doExecute() {
        String time = input[1].trim();
        String name = input[2].trim();
        Double price = Double.parseDouble(input[3].trim());
        Integer num = Integer.parseInt(input[4].trim());
        String type = input[5].trim();
        consumeRecordController.save(time, name, price, num, type);
    }
}
